﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.CityCommand;
using RBAC.MaHaiBo.Entity;
using RBAC.MaHaiBo.Service;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.CityHandler
{
    public class CityCommandHandlers : IRequestHandler<CityCommand, List<City>>
    {
        ICityService CitySer;

        public CityCommandHandlers(ICityService CitySer)
        {
            this.CitySer = CitySer;
        }
        public async Task<List<City>> Handle(CityCommand request, CancellationToken cancellationToken)
        {
            return await CitySer.GetCity( request.provinceId);
        }
    }
}
